package com.yiji.fintech.musfinance.common.domain;

import com.acooly.core.utils.ToString;
import com.yiji.fintech.musfinance.base.enums.*;
import com.yiji.fintech.musfinance.center.deduct.order.facade.DeductFacadeOrder;
import com.yiji.fintech.musfinance.common.annotation.ChannelContext2Domain;
import com.yiji.fintech.musfinance.common.annotation.Field2Filed;
import com.yiji.fintech.musfinance.common.annotation.Order2Domain2Event;
import com.yiji.fintech.musfinance.common.annotation.RuleStrategyAnnotation;
import com.yiji.fintech.musfinance.common.domain.base.BaseDomain;
import com.yiji.fintech.musfinance.common.strategy.converter.Context2DomainDeductStrategy;
import com.yiji.fintech.musfinance.common.strategy.enginerules.DeductRulesStrategy;
import com.yiji.fintech.musfinance.common.eventbus.event.DeductEvent;
import com.yiji.fintech.musfinance.service.TransactionDeductService;
import lombok.Data;

import java.util.Date;

/**
 *
 * Created by ouwen@yiji.com} on 2017/9/13.
 */
@Order2Domain2Event(eventClass = DeductEvent.class,
                    orderClass = DeductFacadeOrder.class,
                    dbServiceClass = TransactionDeductService.class)
@RuleStrategyAnnotation(strategyClass = DeductRulesStrategy.class)
@ChannelContext2Domain(c2dsClass = Context2DomainDeductStrategy.class)
@Data
public class DeductDomain extends BaseDomain {

    /***************付款方***************/
    /**付款-卡号户名*/
    protected String payAccountName;
    /**付款-证件号码*/
    protected String payCertNo;
    /**付款-手机号码*/
    protected String payMobileNo;
    /**付款-卡号*/
    protected String payAccountNo;
    /**付款银行 CCB*/
    @Field2Filed(toFiled = "instBankId")
    protected String payBankId;
    /**签约合同号*/
    protected String contractNo;
    /** 付款-银行省信息*/
    protected String payBankProvince;
    /** 付款-银行市信息*/
    protected String payBankCity;
    /** 付款-证件类型*/
    @Field2Filed(toFiled = "certType")
    private CertTypeEnum payCertType = CertTypeEnum.IDENTITY_CARD;
    /** 付款-卡类型*/
    @Field2Filed(toFiled = "cardType")
    private CardTypeEnum payCardType = CardTypeEnum.DEBIT;
    /** 支付行联行号 */
    private String payBankUnionNo;
    /** 支付行名称 */
    private String payBankName;
    /***************收款方***************/
    /** 收款-卡号*/
    private String recAccountNo;
    /** 收款-卡号户名*/
    private String recAccountName;
    /** 收款-银行ID*/
    private String recBankId;
    /** 收款-银行名称*/
    private String recBankName;
    /** 收款-银行联行号*/
    private String recBankLasalle;
    /** 收款-证件类型*/
    private CertTypeEnum recCertType = CertTypeEnum.IDENTITY_CARD;
    /** 收款-卡类别*/
    private CardTypeEnum recCardType = CardTypeEnum.DEBIT;
    /** 通知状态 */
    private NotifyStatusEnum notifyStatus = NotifyStatusEnum.NO;
    /** 发送网关时间 */
    private Date gatewayTime;

    @Override
    public String toString() {
        return ToString.toString(this);
    }
}
